import java.util.Scanner;

//输入一个5位整数，求他们每一位上数字的和，并输出
public class homework8 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();
        if(number<10000 || number>99999){
            System.out.println("输入的数字不合法");
            return;
        }
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            int digit = number % 10;
            sum += digit;
            number /= 10;
        }
        System.out.println(sum);
    }
}
